package com.handinglian.employee.dto;

import lombok.Data;

import java.util.ArrayList;
import java.util.List;

@Data
public class DepartmentDto {
    /**
     * 主键id
     */
    private Integer departmentId;

    /**
     * 部门名称
     */
    private String departmentName;

    /**
     * 父部门id
     */
    private Integer parentId;

    /**
     * 排序id
     */
    private Integer orderNo;

    /**
     * 该部门下用户数量
     */
    private Integer userNum = 0;

    private List<DepartmentDto> childDepartments = new ArrayList<>();

    public void addDepartment(DepartmentDto departmentDto) {
        childDepartments.add(departmentDto);
    }

    public void removeDepartment(DepartmentDto departmentDto) {
        childDepartments.remove(departmentDto);
    }
}
